#!/bin/bash
cd /data0
#########安装libevent#######
libevent*/configure --prefix=/usr
make
make install

#########安装memcached#######
#tar -zxf memcached*.tar.gz
memcached*/configure --with-libevent=/usr
make
make install

mkdir -p /data1/11200/logs
(
cat<<EOF
memcached -d -m 1024  -u root -l  0.0.0.0 -p 11200 -c 4096 -P /data1/11200/mc.pid -vv >/data1/11200/logs/memcached.log 2>&1

loop=300
for (( i=0;i< \$loop ;i++ ))
do
        sleep 1
        isok=\$(echo "get zh" | telnet 127.0.0.1 11200 | grep Connected)
        if [ -n "\$isok" ]; then
                /boot/dog start_ok
                exit
        fi
done

/boot/dog start_fail
EOF
) >> /boot/startCmd.sh

